package mr

//
// RPC definitions.
//
// remember to capitalize all names.
//

import (
	"os"
)
import "strconv"

//
// example to show how to declare the arguments
// and reply for an RPC.
//

type ExampleArgs struct {
	X int
}

type ExampleReply struct {
	Y int
}

//请求任务参数
type TaskReqArgs struct {
}

//任务信息回复参数
type TaskReplyArgs struct {
	//协作者处于什么阶段
	TaskPhase  string
	FileNames  []string
	TaskId     int
	NMap       int
	NReduce    int
	OutputFile string
}

//任务完成报告参数
type TaskCompleteReqArgs struct {
	//提交的任务的类型
	TaskType string
	TaskId   int
}

//任务完成回复信息
type TaskCompletedReplyArgs struct{}

// Add your RPC definitions here.

//生成一个唯一的 Unix 域套接字路径用于通信
// Cook up a unique-ish UNIX-domain socket name
// in /var/tmp, for the coordinator.
// Can't use the current directory since
// Athena AFS doesn't support UNIX-domain sockets.
func coordinatorSock() string {
	s := "/home/user_yi/824-mr-"
	s += strconv.Itoa(os.Getuid())
	return s
}
